package HeSuanServer.handlerInterceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @描述:
 * @author: LH
 * @date: 2022/12/8
 */
//@Configuration
@Slf4j
public class MyMvcConfig implements WebMvcConfigurer {
//    @Bean
    TokenHandlerInterceptor getTokenHandlerInterceptor(){
        return new TokenHandlerInterceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("拦截器注册");
        registry.addInterceptor(getTokenHandlerInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/Admin/login","/Admin/registry");

    }
}
